Definition:
- Tests which seem to break when they shouldn't
Also Known As:
- Brittle Test
Code Example:
describe Post do
let(:user) { build_stubbed(:user) }
let(:title) { "Example Post" }
subject(:post) { build_stubbed(:post, user: user, title: title) }
# ...
context "with an author" do
let(:user) { build_stubbed(:user, name: "Willy") }
it "returns the author's name" do
expect(post.author_name).to eq("Willy")
end
end
end
References:
Quality attributes
- :octicon:`file-code;1em` - Code Example
- :octicon:`comment-discussion;1em` - Cause and Effect
- :octicon:`graph;1em` - Frequency
- :octicon:`sync;1em` - Refactoring